rm update
[EroBeats.git] / Djinn and Tonic - Erobeats / BGM.cpp
blob3c991225fcd1ac1ef72883e0915b03e0f86cda5f
1 #include "BGM.h"
3 enum BGMKeys {MenuTheme = 0};
5 BGM::BGM()
7 //Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4000);
9 password = "Test";
13 BGM::~BGM()
15 for (int i = 0; i < gameBGM->size(); i++) {
16 Mix_FreeMusic(gameBGM->at(i));
19 Mix_Quit();
22 void BGM::playBGM() {
23 Mix_PlayMusic(gameBGM->at(0), -1);
24 currentBGM = 0;
26 /**/
27 void BGM::playBGM(int bgmNumber) {
28 Mix_PlayMusic(gameBGM->at(bgmNumber), -1);
29 currentBGM = bgmNumber;
31 //Similar to playBGM, but it fades in
32 void BGM::fadeInBGM(int bgmNumber, int duration) {
33 Mix_FadeInMusic(gameBGM->at(currentBGM), -1, duration);
34 currentBGM = bgmNumber;
36 void BGM::fadeOutBGM(int duration) {
37 Mix_FadeOutMusic(duration);
39 /**/
40 void BGM::setVolume(int level) {
41 std::cout << Mix_VolumeMusic(MIX_MAX_VOLUME * level / 4) << " - BGM Volume Level\n";